private subroutine SearchDatumByCode(dat, code)
Search for datum parameters using a code.
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
type(datum),
|
intent(out) |
|
|
:: |
dat |
|
integer,
|
intent(in) |
|
|
:: |
code |
|
Variables
Type |
Visibility | Attributes |
|
Name |
| Initial | |
logical,
|
public |
|
:: |
found |
|
|
|
integer(kind=short),
|
public |
|
:: |
i |
|
|
|
Source Code
SUBROUTINE SearchDatumByCode &
!
(dat, code)
USE StringManipulation, ONLY: &
!Imported routines:
ToString
IMPLICIT NONE
! Arguments with intent(in):
INTEGER, INTENT(IN) :: code
! Arguments with intent(out):
TYPE (Datum), INTENT(OUT) :: dat
! Local variables:
INTEGER (KIND = short) :: i
LOGICAL :: found
!------------end of declaration------------------------------------------------
found = .FALSE.
DO i = 1, SIZE (datums)
IF (datums (i) % code == code ) THEN
dat = datums (i)
found = .TRUE.
END IF
END DO
IF ( .NOT. found ) THEN
CALL Catch ('error', 'GeoLib', &
'datum code not found: ', &
argument = ToString (code) )
END IF
END SUBROUTINE SearchDatumByCode